package work_space;

import java.time.Duration;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;

public class WorkSpaceFactory {
    public static final int MAX_TEA_BREWING = 2;

    public static final int MAX_COFFEE_BREWING = 2;

    public static final Duration COFFEE_BREWING_TIME = Duration.ofSeconds(20); // 45s

    public static final Duration TEA_BREWING_TIME = Duration.ofSeconds(20);// 30s

    public static final Semaphore caffeeBrewingSemaphore = new Semaphore(MAX_COFFEE_BREWING);

    public static final Semaphore teaBrewingSemaphore = new Semaphore(MAX_TEA_BREWING);

    // clientName -> worker
    public static final Map<String, Worker> clientMap = new ConcurrentHashMap<>();

    public static final Map<String, Order> orderMap = new ConcurrentHashMap<>();

    public static final Map<String, Order> waitingArea = new ConcurrentHashMap<>();

    public static final Map<String, Order> brewingArea = new ConcurrentHashMap<>();

    public static final Map<String, Order> trayArea = new ConcurrentHashMap<>();
}
